<!-- 周工作计划 planWeek.jsp -->
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/jsp/common/common.jsp"%>
<html>
	<head>
		<script type="text/javascript" src="<%=contextPath%>/js/jquery.autogrow.js"></script> 
		<script type="text/javascript" src="<%=contextPath%>/js/My97DatePicker/WdatePicker.js"></script>
		<script type="text/javascript" src="<%=contextPath%>/js/validator.js"></script> 
		<script type="text/javascript" language="javascript"> 
		
			// 人行号
			var usernum = 0;
			<c:if test="${planWeekList != null || fn:length(planWeekList) != 0 }">
				usernum = ${fn:length(planWeekList)};
			</c:if>
			
			var bz = '<c:out value="${bz}"/>';
			var isAdmin = '<c:out value="${isAdmin}"/>';
			var plantype= '<c:out value="${searchBean.con6}"/>';
		//	window.alert(plantype);
			$(document).ready (function() {
				//$('textarea.indispensable_left').autogrow();	
				$('textarea').autogrow();		
			});
				
			Ext.onReady(function(){
				var tb = new Ext.Toolbar({
			   		renderTo: document.all.tbar,
			    	items: [
				        {
				            text: '保存',
				            icon:"<%=contextPath%>/images/save.gif",
				            handler:comt,
				            hidden:<%= (!"".equals(request.getAttribute("bz")) || "1".equals(session.getAttribute("SESSION_ISADMIN"))) ? false:true%>
				        }/**,'-',
				        {
				            text: '返回',
				            icon:"<%=contextPath%>/images/fanhui.png",
				            handler:function(){
				            	back();
				            }
				        }*/
			    	]
			    });
			});
			
			function toCheck() {
			
			}

		 </script>  
	</head>
	<body >
	<div id = "tbar" style="position:absolute;display:block left:0px; top:0px; width:100%; height:8%; z-index:1;"></div>
	<br>
	<div id="Layer" style="position:absolute;display:block left:0px; top:36px; width:100%; height:92%; z-index:1000; overflow:auto;">
	
		<br>
		<form id="frmM" name="frmM" method="POST" >
			<s:hidden name="entity.id" />
			<s:hidden name="entity.planweekstart" />
			<s:hidden name="entity.planweekend" />
			<s:hidden name="searchBean.con1" />
			<table width="100%" >
				<tr>
					<td align="center">
						<c:if test="${'1' == searchBean.con6}">变电检修工区车间临时管理周工作安排</c:if>
						<c:if test="${'2' == searchBean.con6}">变电检修工区班组临时管理周工作安排</c:if>
					</td>
				</tr>
					
				<tr >
					<td align="right">
						&nbsp;
						<fmt:formatDate value="${entity.planweekstart}" pattern="yyyy-MM-dd"/>
						<!--<input type="text" size="12" readonly="true" name="entity.planweekstart" id="entity.planweekstart" value='<fmt:formatDate value="${entity.planweekstart}" pattern="yyyy-MM-dd"/>'/>-->
						<!--<img onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('entity.planweekstart')})" src="<%=contextPath%>/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">-->
						&nbsp;
						~
						&nbsp;
						<fmt:formatDate value="${entity.planweekend}" pattern="yyyy-MM-dd"/>
						<!--<input type="text" size="12" readonly="true" name="entity.planweekend"  id="entity.planweekend" value='<fmt:formatDate value="${entity.planweekend}" pattern="yyyy-MM-dd"/>'/>-->
						<!--<img onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('entity.planweekend')})" src="<%=contextPath%>/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">-->
					</td>
				</tr>
			</table>
			<table width="100%" id="listtab" class = "leadertab" >
				<tr >
					<th width="10" >
						<c:if test="${(bz !=''||bz=='gqgl' || '1' == isAdmin)&&entity.id!=null}">
							<img src="<%=contextPath%>/images/add.gif" onclick = "setHTML()" style="cursor:pointer"/>
						</c:if></th>
					<th width="10%" >责任班组</th>
					<th width="90" >${'1' == searchBean.con6?"计划开始日期":"工作开始日期"}</th>
					<th width="90" >${'1' == searchBean.con6?"计划完成日期":"工作结束日期"}</th>
					 <c:if test="${'2' == searchBean.con6}"> <th width="60" nowrap="nowrap">工作类别</th></c:if>
					<th width="20%" >工作内容</th>
					<th width="10%" >责任人</th>
					<c:if test="${'2' == searchBean.con6}"> <th width="50" >工时</th></c:if>
					<c:if test="${'2' == searchBean.con6}"> <th width="10%" >完成情况</th></c:if>
						<c:if test="${'2' == searchBean.con6}"> <th width="10%" >遗留问题</th></c:if>
				   <c:if test="${'1' == searchBean.con6}"> <th width="90" >实际完成日期</th></c:if>
					<th><span><center>备注</center></span></th>
				</tr>
				
				
				<c:forEach items="${planWeekList}" var="detail" varStatus="status">
					<tr id='tr${status.index}' class = "repeat">
						<th width="10">
							<c:if test="${(fn:contains(detail.bzname,bz)||bz=='gqgl' || '1' == isAdmin)&&entity.id!=null}">
								<img src="<%=contextPath%>/images/delete.gif" onclick = "delrow(this,${detail.id})" style="cursor:pointer"/></th>
							</c:if>
						<td width="20%">
						<input type="hidden" id="planWeekList[${status.index}].bz" name="planWeekList[${status.index}].bz" value = "${detail.bz}"/>
							<input type="text" readonly="true" style="width:80%" id="planWeekList[${status.index}].bzname" name="planWeekList[${status.index}].bzname" value = "${detail.bzname}"/>
							<img style='cursor:pointer' src="<%=contextPath%>/images/editlink.gif" title="" onClick="javascript:getBz('planWeekList[${status.index}].bz','planWeekList[${status.index}].bzname','searchBean.con1')" />
						
							</td>
						<td width="70">
							<c:if test="${fn:contains(detail.bzname,bz)||bz=='gqgl' || '1' == isAdmin}">
								<input type="text" style="width:100%" 
									id="planWeekList[${status.index}].startdate" 
									name="planWeekList[${status.index}].startdate"  datatype="Require" msg=${'1' == searchBean.con6?"计划开始日期必须输入。":"工作开始日期必须输入。"}
									onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('planWeekList[${status.index}].startdate')})" 
									readonly="true" value='<fmt:formatDate value="${detail.startdate}" pattern="yyyy-MM-dd"/>' />
							</c:if>
							<c:if test="${!fn:contains(detail.bzname,bz) &&bz!='gqgl'&& '0' == isAdmin}">
								<input type="text" style="width:100%" 
									id="planWeekList[${status.index}].startdate" 
									name="planWeekList[${status.index}].startdate" 
									readonly="true" value='<fmt:formatDate value="${detail.startdate}" pattern="yyyy-MM-dd"/>' />
							</c:if>

						</td>
						<td width="70">
							<c:if test="${fn:contains(detail.bzname,bz)||bz=='gqgl' || '1' == isAdmin}">
								<input type="text" style="width:100%" 
									id="planWeekList[${status.index}].enddate" 
									name="planWeekList[${status.index}].enddate"  datatype="Require" msg=${'1' == searchBean.con6?"计划完成日期必须输入。":"工作结束日期必须输入。"}
									onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('planWeekList[${status.index}].enddate')})" 
									readonly="true" value='<fmt:formatDate value="${detail.enddate}" pattern="yyyy-MM-dd"/>' />
							</c:if>
							<c:if test="${!fn:contains(detail.bzname,bz) &&bz!='gqgl'&& '0' == isAdmin}">
								<input type="text" style="width:100%" 
									id="planWeekList[${status.index}].enddate" 
									name="planWeekList[${status.index}].enddate"
									readonly="true" value='<fmt:formatDate value="${detail.enddate}" pattern="yyyy-MM-dd"/>' />
							</c:if>

						</td>
							<c:if test="${'2' == searchBean.con6}"> 
								<td >
							<c:if test="${fn:contains(detail.bzname,bz)||bz=='gqgl' || '1' == isAdmin}">
								<textarea style="width:100; height: 25px; min-height: 20px;line-height:12pt" id="planWeekList[${status.index}].gzlb" name="planWeekList[${status.index}].gzlb" >${detail.gzlb}</textarea>
									</c:if>
							<c:if test="${!fn:contains(detail.bzname,bz) &&bz!='gqgl'&& '0' == isAdmin}">
								<textarea style="width:100; height: 25px; min-height: 20px;line-height:15pt" id="planWeekList[${status.index}].gzlb" name="planWeekList[${status.index}].gzlb" readonly="true" >${detail.gzlb}</textarea>
							</c:if>
							</td>
								</c:if>
							<td width="30%">
							<c:if test="${fn:contains(detail.bzname,bz)||bz=='gqgl' || '1' == isAdmin}">
								<textarea style="width:99%; height: 25px; min-height: 20px;line-height:12pt" id="planWeekList[${status.index}].bzwwcxjyy" name="planWeekList[${status.index}].bzwwcxjyy" >${detail.bzwwcxjyy}</textarea>
								<!--<input type="text" style="width:100%" id="planWeekList[${status.index}].bzwwcxjyy" name="planWeekList[${status.index}].bzwwcxjyy" value = "${detail.bzwwcxjyy}" maxlength="200"/>-->
							</c:if>
							<c:if test="${!fn:contains(detail.bzname,bz) &&bz!='gqgl'&& '0' == isAdmin}">
								<textarea style="width:99%; height: 25px; min-height: 20px;line-height:15pt" id="planWeekList[${status.index}].bzwwcxjyy" name="planWeekList[${status.index}].bzwwcxjyy" readonly="true" >${detail.bzwwcxjyy}</textarea>
								<!--<input readonly="true" type="text" style="width:100%" id="planWeekList[${status.index}].bzwwcxjyy" name="planWeekList[${status.index}].bzwwcxjyy" value = "${detail.bzwwcxjyy}" readonly="true" />-->
							</c:if>
							</td>
					
						<td width="270" >
							<c:if test="${fn:contains(detail.bzname,bz)||bz=='gqgl' || '1' == isAdmin}">
								<input type="text" readonly="true" style="width:80%" id="planWeekList[${status.index}].fzrname" name="planWeekList[${status.index}].fzrname" value = "${detail.fzrname}"/>
							<img style='cursor:pointer' src="<%=contextPath%>/images/editlink.gif" title="" onClick="javascript:getUser('planWeekList[${status.index}].fzr','planWeekList[${status.index}].fzrname','searchBean.con1')" />
								</c:if>
							<c:if test="${!fn:contains(detail.bzname,bz) &&bz!='gqgl'&& '0' == isAdmin}">
								<input type="text" readonly="true" style="width:80%" id="planWeekList[${status.index}].fzrname" name="planWeekList[${status.index}].fzrname" value = "${detail.fzrname}" readonly="true"/>
								</c:if>
								<input type="hidden" id="planWeekList[${status.index}].fzr" name="planWeekList[${status.index}].fzr" value = "${detail.fzr}"/>
							
						</td>
						<c:if test="${'2' == searchBean.con6}"> 
								<td width="50">
							<c:if test="${fn:contains(detail.bzname,bz)||bz=='gqgl' || '1' == isAdmin}">
								<textarea style="width:50; height: 25px; min-height: 20px;line-height:12pt" id="planWeekList[${status.index}].gs" name="planWeekList[${status.index}].gs" >${detail.gs}</textarea>
									</c:if>
							<c:if test="${!fn:contains(detail.bzname,bz) &&bz!='gqgl'&& '0' == isAdmin}">
								<textarea style="width:50; height: 25px; min-height: 20px;line-height:15pt" id="planWeekList[${status.index}].gs" name="planWeekList[${status.index}].gs" readonly="true" >${detail.gs}</textarea>
							</c:if>
							</td>
								</c:if>
								<c:if test="${'2' == searchBean.con6}"> 
								<td width="10%">
							<c:if test="${fn:contains(detail.bzname,bz)||bz=='gqgl' || '1' == isAdmin}">
								<textarea style="width:99%; height: 25px; min-height: 20px;line-height:12pt" id="planWeekList[${status.index}].wcqk" name="planWeekList[${status.index}].wcqk" >${detail.wcqk}</textarea>
									</c:if>
							<c:if test="${!fn:contains(detail.bzname,bz) &&bz!='gqgl'&& '0' == isAdmin}">
								<textarea style="width:99%; height: 25px; min-height: 20px;line-height:15pt" id="planWeekList[${status.index}].wcqk" name="planWeekList[${status.index}].wcqk" readonly="true" >${detail.wcqk}</textarea>
							</c:if>
							</td>
								</c:if>
								<c:if test="${'2' == searchBean.con6}"> 
								<td width="10%">
							<c:if test="${fn:contains(detail.bzname,bz)||bz=='gqgl' || '1' == isAdmin}">
								<textarea style="width:99%; height: 25px; min-height: 20px;line-height:12pt" id="planWeekList[${status.index}].ylwt" name="planWeekList[${status.index}].ylwt" >${detail.ylwt}</textarea>
									</c:if>
							<c:if test="${!fn:contains(detail.bzname,bz) &&bz!='gqgl'&& '0' == isAdmin}">
								<textarea style="width:99%; height: 25px; min-height: 20px;line-height:15pt" id="planWeekList[${status.index}].ylwt" name="planWeekList[${status.index}].ylwt" readonly="true" >${detail.ylwt}</textarea>
							</c:if>
							</td>
								</c:if>
						 <c:if test="${'1' == searchBean.con6}"> 
					<td width="70">
							<c:if test="${fn:contains(detail.bzname,bz)||bz=='gqgl' || '1' == isAdmin}">
								<input type="text" style="width:70" 
									id="planWeekList[${status.index}].sjwcdate" 
									name="planWeekList[${status.index}].sjwcdate"  datatype="Require" msg="实际完成日期必须输入。"
									onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('planWeekList[${status.index}].sjwcdate')})" 
									readonly="true" value='<fmt:formatDate value="${detail.sjwcdate}" pattern="yyyy-MM-dd"/>' />
							</c:if>
							<c:if test="${!fn:contains(detail.bzname,bz) &&bz!='gqgl'&& '0' == isAdmin}">
								<input type="text" style="width:70" 
									id="planWeekList[${status.index}].sjwcdate" 
									name="planWeekList[${status.index}].sjwcdate"
									readonly="true" value='<fmt:formatDate value="${detail.sjwcdate}" pattern="yyyy-MM-dd"/>' />
							</c:if>

						</td>
						</c:if>
						<td width="10%">
							<c:if test="${fn:contains(detail.bzname,bz)||bz=='gqgl' || '1' == isAdmin}">
								<textarea style="width:99%; height: 25px; min-height: 20px;line-height:12pt" id="planWeekList[${status.index}].remark" name="planWeekList[${status.index}].remark" >${detail.remark}</textarea>
								<!--<input type="text" style="width:100%" id="planWeekList[${status.index}].remark" name="planWeekList[${status.index}].remark" value = "${detail.remark}" maxlength="200"/>-->
							</c:if>
							<c:if test="${!fn:contains(detail.bzname,bz) &&bz!='gqgl'&& '0' == isAdmin}">
								<textarea style="width:99%; height: 25px; min-height: 20px;line-height:15pt" id="planWeekList[${status.index}].remark" name="planWeekList[${status.index}].remark" readonly="true" >${detail.remark}</textarea>
								<!--<input readonly="true" type="text" style="width:100%" id="planWeekList[${status.index}].remark" name="planWeekList[${status.index}].remark" value = "${detail.remark}" readonly="true" />-->
							</c:if>
							<input type="hidden" id="planWeekList[${status.index}].id" name="planWeekList[${status.index}].id" value = "${detail.id}"/>
						<input type="hidden" id="planWeekList[${status.index}].plantype" name="planWeekList[${status.index}].plantype" value = "${searchBean.con6}"/>
						<input type="hidden" id="planWeekList[${status.index}].planweekid" name="planWeekList[${status.index}].planweekid" value = "${detail.planweekid}"/>
							
						</td>

					</tr>
				</c:forEach>
				
			
			</table>
		</form>
		<div>
	</body>
</html>
<script language="javascript">

		String.prototype.endWith=function(str){
				if(str==null||str==""||this.length==0||str.length>this.length)
				return false;
				if(this.substring(this.length-str.length)==str)
				return true;
				else
				return false;
				return true;
		}

	 // 保存
     function comt(){
     
		var str1 = 0;
		var str2 = 0;
		var msg = "";
	
		/**for (var i = 0; i < frmM.elements.length; i++)
			{
				var e = frmM.elements[i];
				e.style.backgroundColor = "white";

				if ("text" == e.type || "textarea" == e.type) { //(e.name.endWith("date")) {
				    if (e.value == ""&&!e.name.endWith("bzwwcxjyy")) {
				    	e.style.backgroundColor="yellow";
				    	++str1;
				    }
				}
				
				if ("textarea" == e.type && e.value.length > 200) {
					e.style.backgroundColor="red";
					++str2;
				}
				    
			}

			if (str1 > 0 || str2 > 0) {
				msg =  "黄色边框项目必须输入，红色边框最多输入200个汉字。";
			}
				
			if (msg.length > 0) {
				alert("系统检测到您的提交有以下错误：\t\t\t\t\n" + msg);
				return;
			}*/
     if(!Validator.Validate(frmM,2)){
				  return false;
			  	}
     
     	document.frmM.action = "<%=contextPath%>/planWeek!save.do";
     	document.frmM.submit();
     }
     
     // 返回
     function back() {
     	document.frmM.action = "<%=contextPath%>/planWeekList!getList.do";
		document.frmM.submit();
     }
	 
	 // 增加行
	 function setHTML() {
	 	//window.alert(plantype);
	 		var temp0 = "WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('planWeekList[" + usernum + "].startdate')})";			
	 var temp1 = "WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('planWeekList[" + usernum + "].enddate')})";
	 var temp2 = "WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('planWeekList[" + usernum + "].wcsjdate')})";
		var str = 	'<tr id = '+ usernum +' class = "repeat">' +
					'<td ><img src="<%=contextPath%>/images/delete.gif" onclick = "delrow(this,0)" style="cursor:pointer"/></td>' + 
					'<td width="20%"><input style="width:80%" datatype="Require" type="text" id=planWeekList['+ usernum + '].bzname name=planWeekList['+ usernum + '].bzname msg="责任班组必须输入。"/><input type="hidden" id="planWeekList['+ usernum + '].bz" name="planWeekList['+ usernum + '].bz" /><img style="cursor:pointer" src="<%=contextPath%>/images/editlink.gif" title="" onClick="javascript:getBz(\'planWeekList['+ usernum + '].bz\',\'planWeekList['+ usernum + '].bzname\',\'searchBean.con1\')" /></td >' +
					'<td><input  onclick="' + temp0 + '" style="width:70" type="text" id=planWeekList['+ usernum + '].startdate name=planWeekList['+ usernum + '].startdate readonly="true" /></td >' +
         	'<td><input  onclick="' + temp1 + '" style="width:70" type="text" id=planWeekList['+ usernum + '].enddate name=planWeekList['+ usernum + '].enddate readonly="true" datatype="Require" msg="计划结束日期必须输入。"/></td >' +
        '<td ><textarea style="width:100%; height: 25px; min-height: 20px;line-height:15pt" id=planWeekList['+ usernum + '].bzwwcxjyy name=planWeekList['+ usernum + '].bzwwcxjyy datatype="Require" msg="工作内容必须输入。"></textarea>' +
         '<td width="10%"><input style="width:80%" type="text" id=planWeekList['+ usernum + '].fzrname name=planWeekList['+ usernum + '].fzrname datatype="Require" msg="责任人必须输入。"/><input type="hidden" id="planWeekList['+ usernum + '].fzr" name="planWeekList['+ usernum + '].fzr" /><img style="cursor:pointer" src="<%=contextPath%>/images/editlink.gif" title="" onClick="javascript:getUser(\'planWeekList['+ usernum + '].fzr\',\'planWeekList['+ usernum + '].fzrname\')" /></td >' + 	 
       	'<td ><input  onclick="' + temp2 + '" style="width:70" type="text" id=planWeekList['+ usernum + '].sjwcdate name=planWeekList['+ usernum + '].sjwcdate readonly="true" /></td >' +
					 '<td ><textarea style="width:200px; height: 25px; min-height: 2px;line-height:15pt" id=planWeekList['+ usernum + '].remark name=planWeekList['+ usernum + '].remark></textarea></td >' +
			'<input type="hidden" id=planWeekList['+ usernum + '].id name=planWeekList['+ usernum + '].id value ="0">'+
			'<input type="hidden" id=planWeekList['+ usernum + '].plantype name=planWeekList['+ usernum + '].plantype value = "${searchBean.con6}"></td >' +
					
					'</tr>';
					var str1 = 	'<tr id = '+ usernum +' class = "repeat">' +
					'<td ><img src="<%=contextPath%>/images/delete.gif" onclick = "delrow(this,0)" style="cursor:pointer"/></td>' + 
					'<td><input style="width:80" type="text" datatype="Require" id=planWeekList['+ usernum + '].bzname name=planWeekList['+ usernum + '].bzname msg="责任班组必须输入。"/><input type="hidden" id="planWeekList['+ usernum + '].bz" name="planWeekList['+ usernum + '].bz" /><img style="cursor:pointer" src="<%=contextPath%>/images/editlink.gif" title="" onClick="javascript:getBz(\'planWeekList['+ usernum + '].bz\',\'planWeekList['+ usernum + '].bzname\',\'searchBean.con1\')" /></td >' +
					'<td ><input  onclick="' + temp0 + '" style="width:70" type="text" id=planWeekList['+ usernum + '].startdate name=planWeekList['+ usernum + '].startdate readonly="true" datatype="Require" msg="计划开始日期必须输入。"/></td >' +
         	'<td ><input  onclick="' + temp1 + '" style="width:70" type="text" id=planWeekList['+ usernum + '].enddate name=planWeekList['+ usernum + '].enddate readonly="true" /></td >' +
       '<td><textarea style="width:100; height: 25px; min-height: 20px;line-height:15pt" id=planWeekList['+ usernum + '].gzlb name=planWeekList['+ usernum + '].gzlb ></textarea>' +
       '<td ><textarea style="width:200; height: 25px; min-height: 20px;line-height:15pt" id=planWeekList['+ usernum + '].bzwwcxjyy name=planWeekList['+ usernum + '].bzwwcxjyy datatype="Require" msg="工作内容必须输入。"></textarea>' +
       '<td><input style="width:100" type="text" id=planWeekList['+ usernum + '].fzrname name=planWeekList['+ usernum + '].fzrname datatype="Require" msg="责任人必须输入。"/><input type="hidden" id="planWeekList['+ usernum + '].fzr" name="planWeekList['+ usernum + '].fzr" /><img style="cursor:pointer" src="<%=contextPath%>/images/editlink.gif" title="" onClick="javascript:getUser(\'planWeekList['+ usernum + '].fzr\',\'planWeekList['+ usernum + '].fzrname\')" /></td >' + 	 
      '<td ><textarea style="width:40; height: 25px; min-height: 20px;line-height:15pt" id=planWeekList['+ usernum + '].gs name=planWeekList['+ usernum + '].gs datatype="Require" msg="工时必须输入。"></textarea>' +
       '<td ><textarea style="width:100; height: 25px; min-height: 20px;line-height:15pt" id=planWeekList['+ usernum + '].wcqk name=planWeekList['+ usernum + '].wcqk ></textarea>' +
       '<td ><textarea style="width:100; height: 25px; min-height: 20px;line-height:15pt" id=planWeekList['+ usernum + '].ylwt name=planWeekList['+ usernum + '].ylwt ></textarea>' +
        '<td ><textarea style="width:200px; height: 25px; min-height: 2px;line-height:15pt" id=planWeekList['+ usernum + '].remark name=planWeekList['+ usernum + '].remark></textarea></td >' +
			'<input type="hidden" id=planWeekList['+ usernum + '].id name=planWeekList['+ usernum + '].id value ="0">'+
			'<input type="hidden" id=planWeekList['+ usernum + '].plantype name=planWeekList['+ usernum + '].plantype value = "${searchBean.con6}"></td >' +
					
					'</tr>';
					if(plantype=='1'){
						str=str;
					}else{
						str=str1;
					}
					//alert(str);
		$('table.leadertab').append(str);	
				
		usernum++;
		
		// 重新付序号
//		var n = 0;		
//		for (var index=0;index<usernum; index++) {
//			if (document.getElementById("td" + index) != null && document.getElementById("td" + index) != undefined) {
//				++n;
//				document.getElementById("td" + index).innerHTML = n;
//			}
//		}				
//	 }

		$('textarea').autogrow();	
	
	}
	
	//删除一行（已有数据）
	function delrow(row,id){


		if (confirm("确定要删除该工作计划吗？")) {
			if(id != 0) {
				Ext.Ajax.request({
					method :'POST',
					url :'planWeek!deletePlanDetail.do?detailid=' + id,
					params : {},
					success : function(response, options) {
						var obj = Ext.decode(response.responseText);
						Ext.MessageBox.alert('提示', obj["msg"]);
					
	   					$(row).parents(".repeat").remove();	

					},
					failure : function(response, options) {
						Ext.MessageBox.alert('提示 ', '删除失败。');
					}
				});
			} else {
				$(row).parents(".repeat").remove();	
			}

		}

	} 
</script>